Skip to content

ext/phar: continue process of using zend_string* for alias arguments#21932

Open
Girgias wants to merge 4 commits intophp:masterfrom
Girgias:2026-04-phar-open-or-create-filename-zstr
Open

ext/phar: continue process of using zend_string* for alias arguments#21932
Girgias wants to merge 4 commits intophp:masterfrom
Girgias:2026-04-phar-open-or-create-filename-zstr

Conversation

@Girgias
Copy link
Copy Markdown
Member

@Girgias Girgias commented May 2, 2026

Commits should be reviewed in order.

@Girgias Girgias force-pushed the 2026-04-phar-open-or-create-filename-zstr branch from 5273abe to 251a774 Compare May 2, 2026 16:14
Comment thread ext/phar/phar_object.c Outdated
Comment thread ext/phar/phar.c

if (alias_len && alias) {
if (NULL == zend_hash_str_add_ptr(&(PHAR_G(phar_alias_map)), alias, alias_len, mydata)) {
if (alias) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note there is subtle change of behaviour throughout. i.e. empty values are potentially accepted ?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should even be accepting empty aliases in the first place.

Girgias added 4 commits May 4, 2026 14:01
As we want to use it to lookup hash tables and in the future copy it.
Required removing some const qualifiers on zend_string* and propagate the change to simplify the code.
@Girgias Girgias force-pushed the 2026-04-phar-open-or-create-filename-zstr branch from 251a774 to ba1f156 Compare May 4, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants